.products-container {
    min-height: 100vh;
    background: url('../images/5.jpg') center/cover no-repeat fixed;
    padding: 2rem;
    position: relative;
}

.products-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1;
}

.page-title {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    margin: 0 0 0.5rem;
    color: #333;
}

.description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.price-info {
    margin-bottom: 1rem;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    margin-right: 1rem;
}

.current-price {
    color: #ff4757;
    font-size: 1.2rem;
    font-weight: bold;
}

.product-actions {
    display: flex;
    gap: 1rem;
}

.product-actions button {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-to-cart {
    background: #ff9f43;
    color: white;
}

.add-to-cart:hover {
    background: #ff8f30;
}

.buy-now {
    background: #ff4757;
    color: white;
}

.buy-now:hover {
    background: #ff3747;
}

.login-required {
    background: #70a1ff;
    color: white;
    width: 100%;
}

.login-required:hover {
    background: #5c8fff;
}

/* 购物车悬浮按钮 */
.cart-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #ff4757;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.3s;
}

.cart-button:hover {
    transform: scale(1.1);
}

.cart-icon {
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff9f43;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: white;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.order-summary {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.confirm-purchase {
    width: 100%;
    padding: 1rem;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.confirm-purchase:hover {
    background: #ff3747;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .products-container {
        padding: 1rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1rem;
    }
}

.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background-color: rgba(46, 204, 113, 0.9);
    color: white;
    border-radius: 4px;
    z-index: 1000;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 商品描述相关样式 */
.short-description {
    margin: 10px 0;
    color: #666;
    line-height: 1.4;
}

.full-description {
    margin: 15px 0;
    color: #333;
    line-height: 1.6;
    font-size: 0.9em;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.detail-btn {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 10px 0;
    transition: all 0.3s ease;
}

.detail-btn:hover {
    background: #3498db;
    color: white;
}

/* 美化滚动条 */
.full-description::-webkit-scrollbar {
    width: 6px;
}

.full-description::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.full-description::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.full-description::-webkit-scrollbar-thumb:hover {
    background: #555;
}
